<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<!DOCTYPE html PUBLIC>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>前台顾客管理</title>
<link rel="stylesheet" type="text/css"
	href="/three/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css"
	href="/three/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css"
	href="/three/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css"
	href="/three/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css"
	href="/three/static/h-ui.admin/css/style.css" />
<script type="text/javascript" src="/three/lib/jquery/1.9.1/jquery.js"></script>
<script type="text/javascript" src="/three/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/three/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript"
	src="/three/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript"
	src="/three/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript"
	src="/three/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/three/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/three/static/formEdit.js"></script>
</head>
<body>
	<form action="/three/custom1/list" method="post" id="form1">
		<div class="text-l">
			账 号:<input type="text" name="qmobile" id="qmobile" class="input-text"
				style="width: 230px"> 姓 名:<input type="text"
				name="qusername" id="qusername" class="input-text"
				style="width: 230px"> 生日筛选:<input type="date"
				class="input-text" name="qborndate" id="qborndate"
				style="width: 230px"><br> 颜 值:<select name="qbeautynum"
				id="qbeautynum" class="input-text" style="width: 230px">
				<option value=""></option>
				<option value="0">无</option>
				<option value="1">有</option>
			</select> 礼 包:<select name="qbagnum" id="qbag4num" class="input-text"
				style="width: 230px">
				<option value=""></option>
				<option value="0">无</option>
				<option value="1">有</option>
			</select>
			<button type="submit" class="btn btn-primary">
				<i class="Hui-iconfont">&#xe665;</i>查询
			</button>
			<button type="button" class="btn btn-primary" id="resetBtn">
				<i class="Hui-iconfont">&#xe68f;</i>重置
			</button>
		</div>
	</form>
	<div class="pd-20">
		<div class="text-c"></div>
		<table
			class="table table-border table-bordered table-hover table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th>头像</th>
					<th>会员号</th>
					<th>账号</th>
					<th>姓名</th>
					<th>昵称</th>
					<th>性别</th>
					<th>生日</th>
					<th>持有颜值</th>
					<th>礼包</th>
					<th>最近到店时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${customList }" var="list">
					<tr class="text-c">
						<td><img src="http://localhost:8080/three/upload/${list.photo }">
						</td>
						<td>${list.custom_user_id }</td>
						<td>${list.mobile }</td>
						<td>${list.username }</td>
						<td>${list.nikename }</td>
						<td><c:if test="${list.sex=='0'  }">男</c:if> <c:if
								test="${list.sex=='1'  }">女</c:if> <c:if
								test="${list.sex=='2'  }">保密</c:if></td>
						<td><f:formatDate value="${list.born_date }"
								pattern="yyyy-MM-dd" /></td>
						<td><c:if test="${list.beauty_num==0 }">无</c:if> <c:if
								test="${list.beauty_num>0 }">${list.beauty_num }</c:if></td>
						<td><c:if test="${list.bag_num<=0 }">无</c:if> <c:if
								test="${list.bag_num>0 }">有</c:if></td>
						<td><f:formatDate value="${list.recent_time }"
								pattern="yyyy-MM-dd HH:mm:ss" /></td>
						<td><a title="查看" href="javascript:;"
							onclick="modalshow('${list.custom_user_id}')" class="ml-5"
							style="text-decoration: none"> <i class="Hui-iconfont">&#xe715;</i>查看资料
						</a> <a title="查看" href="javascript:;"
							onclick="modal1show(${list.custom_user_id})" class="ml-5"
							style="text-decoration: none"> <i class="Hui-iconfont">&#xe715;</i>消费情况
						</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<div id="modal" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content radius">
				<div class="modal-header">
					<h3 class="modal-title">查看资料</h3>
					<a class="close" data-dismiss="modal" aria-hidden="true"
						href="javascript:void();">×</a>
				</div>
				<div class="modal-body">
					<form method="post" name="form2" id="form2">
						<table
							class="table table-border table-bordered table-bg table-hover table-responsive">
							<tr>
								<td>顾客账号</td>
								<td><input type="text" class="input-text radius size-L"
									name="mobile" value="" readonly></td>
								<td>顾客姓名</td>
								<td><input type="text" class="input-text radius size-L"
									name="username" value="" readonly></td>
								<td rowspan="3"></td>
							</tr>
							<tr>
								<td>性别</td>
								<td><span class="select-box"> <select
										class="select" size="1" name="sex" disabled="disabled">
											<option value="0">男</option>
											<option value="1">女</option>
											<option value="2">保密</option>
									</select>
								</span></td>
								<td>顾客生日</td>
								<td><input type="text" class="input-text radius size-L"
									name="borndate" value="" readonly></td>
							</tr>
							<tr>
								<td>注册时间</td>
								<td><input type="text" class="input-text radius size-L"
									name="enrolltime" value="" readonly></td>
								<td>持有颜值</td>
								<td><input type="text" class="input-text radius size-L"
									name="beautynum" value="" readonly></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>

	<div id="modal1" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content radius">
				<div class="modal-header">
					<h3 class="modal-title">消费情况</h3>
					<a class="close" data-dismiss="modal" aria-hidden="true"
						href="javascript:void();">×</a>
				</div>
				<div class="modal-body">
					<form method="post" id="form3" name="form3"
						action="/three/custom1/list1">
						<div class="text-l">
							顾客账号:<span><input type="text"
								class="input-text radius size-L" name="mobile" value=""></span>
							顾客姓名:<span><input type="text"
								class="input-text radius size-L" name="username" value=""></span><br>
							订单编号:<input type="text" name="qorderid" id="qorderid"
								class="input-text" style="width: 150px"> 消费内容:<input
								type="text" name="qordercontent" id="qordercontent"
								class="input-text" style="width: 150px"><br> 支付方式:<select
								name="qpayway" id="qpayway" class="input-text"
								style="width: 150px">
								<option value="1">微信</option>
								<option value="2">支付宝</option>
								<option value="3">美颜币</option>
								<option value="4">套餐</option>
							</select>
						</div>
						<table
							class="table table-border table-bordered table-bg table-hover table-responsive">
							<thead>
								<tr class="text-c">
									<th>订单编号</th>
									<th>消费内容</th>
									<th>价格(元)</th>
									<th>实付金额(元)</th>
									<th>消耗颜值(个)</th>
									<th>支付方式</th>
									<th>支付时间</th>
									<th>服务员工</th>
									<th>操作员工</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${customList1 }" var="list1">
									<tr class="text-c">
										<td class="text-c">${list1.order_id }</td>
										<td class="text-c">${list1.order_content }</td>
										<td class="text-c">${list1.order_money }</td>
										<td class="text-c">${list1.pay_money }</td>
										<td class="text-c">${list1.extend_beauty_num }</td>
										<td class="text-c"><c:if test="${list1.pay_way==1 }">微信</c:if>
											<c:if test="${list1.pay_way==2 }">支付宝</c:if> <c:if
												test="${list1.pay_way==3 }">美颜币</c:if> <c:if
												test="${list1.pay_way==4 }">套餐</c:if></td>
										<td class="text-c"><f:formatDate
												value="${list1.pay_time }" pattern="yyyy-MM-dd HH:mm:ss" />
										</td>
										<td class="text-c">${list1.server_user_id }</td>
										<td class="text-c">${list1.handle_user_id }</td>
										<td class="text-c"><c:if test="${list1.order_status==0 }">草稿</c:if>
											<c:if test="${list1.order_status==1 }">已预约</c:if> <c:if
												test="${list1.order_status==2 }">服务中</c:if> <c:if
												test="${list1.order_status==3 }">待支付</c:if> <c:if
												test="${list1.order_status==4 }">已支付</c:if> <c:if
												test="${list1.order_status==5 }">已完成</c:if> <c:if
												test="${list1.order_status==6 }">已过期</c:if> <c:if
												test="${list1.order_status==7 }">已撤销</c:if></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>

	<div id="modal2" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width: 1000px">
			<div class="modal-content radius">
				<div class="modal-header">
					<h3 class="modal-title">查看顾客详细信息</h3>
					<a class="close" data-dismiss="modal" aria-hidden="true"
						href="javascript:void();">×</a>
				</div>
				<div class="modal-body">
					<form action="" method="post" id="form1">
						<table class="table table-hover" width="90%" align="center">
							<tr>
								<td>顾客账号</td>
								<td><input type="text" class="form-control"
									disabled="disabled" name="mobile1" id="mobile1" value="" /></td>
								<td>顾客姓名</td>
								<td><input type="text" class="form-control"
									disabled="disabled" name="username1" id="username1" value="" /></td>
								<td></td>
								<td></td>
								<td></td>
							</tr>
							<!--							<tr>
								<td>订单编号</td>
								<td><input type="text" class="form-control" placeholder="请输入订单编号" name="orderId" value="" /></td>
								<td>消费内容</td>
								<td><input type="text" class="form-control" name="orderContent" value="" /></td>
								<td>支付方式</td>
								<td>
									<select name="payWay">
										<option value="">请选择</option>
										<option value="1">微信</option>
										<option value="2">支付宝</option>
										<option value="3">美颜币</option>
										<option value="4">套餐</option>
									</select>
								</td>
								<td>
									<button class="btn btn-primary" id="cx" onclick="xfqk('${c.custom_user_id}')">查询</button>
									<button class="btn btn-primary">重置</button>
								</td>
							</tr>-->
						</table>
					</form>
					<table class="table table-hover" width="90%" align="center"
						id="tbody">
						<tr>
							<th>订单编号</th>
							<th>消费内容</th>
							<th>价格(元)</th>
							<th>实付金额(元)</th>
							<th>消耗颜值(个)</th>
							<th>支付方式</th>
							<th>支付时间</th>
							<th>服务员工</th>
							<th>操作员工</th>
							<th>状态</th>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>

</body>
<script type="text/javascript">
//分页
$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
});
//查看资料
function modalshow(id){
	$.ajax({
		type : 'POST',
		dataType : "json",
		url : "/three/custom1/select",
		data:{
			customUserId: id
		},
		success : function(msg) {
			if(msg!=null){					
				$("#form2").formEdit(msg);
				$("#modal").modal("show");
			}
		}
	});
}
//消费情况
function modal1show(id){	
	$("#modal1").modal("show");
}
</script>
</html>